package code.springboot.mybatis.mapper;

import code.springboot.mybatis.annotation.MapF2F;
import code.springboot.mybatis.entity.User;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Mapper;

import java.util.Map;

@Mapper
public interface UserMapper {

    /**
     * 根据ID获取用户
     *
     * @param id id
     * @return {@link User}
     */
    User selectById(Long id);

    /**
     * 根据ID名称获取用户
     *
     * @param id   id
     * @param name 名字
     * @return {@link User}
     */
    User selectByIdAndName(Long id, String name);

    @MapF2F()
    Map<String, String> selectUserMap(Long id);
}
